#ifndef SINGLETONE_UTILS_H
#define SINGLETONE_UTILS_H

#include <boost\noncopyable.hpp>
#include <boost\thread\mutex.hpp>

namespace utils
{
	template <typename T>
	class singltone: public boost::noncopyable
	{
	public:
		static T& instance()
		{
			boost::mutex::scoped_lock lock(m_mutex);
			static T t;
			return t;
		}
	private:
		singltone();
		static boost::mutex m_mutex;
	};

	template <typename T>
	boost::mutex singltone<T>::m_mutex;
}

#endif